# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
#
# This package is completely broken, the current setup does not build and the
# new process doesn't as well

pkgname=xray
pkgver=109.7e8cc67
pkgrel=1
groups=('blackarch' 'blackarch-recon')
pkgdesc='A tool for recon, mapping and OSINT gathering from public networks.'
arch=('x86_64' 'aarch64')
url='https://github.com/evilsocket/xray'
license=('GPL3')
depends=('glibc')
makedepends=('git' 'go-pie' 'golang-glide')
source=('git+https://github.com/evilsocket/xray.git')
sha512sums=('SKIP')
_url='github.com/evilsocket/xray'

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  mkdir -p "src/$_url" && rm -rf "src/$_url" && mv $pkgname "src/$_url" &&
    cd "src/$_url"

  GOPATH="$srcdir" go get -d -t $_url
  GOPATH="$srcdir" go get -u github.com/jteeuwen/go-bindata/...
  make
}

package() {
  cd "src/$_url"

  install -Dm 755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

